package com.tyk.bookstore.back.order.model.entity;


import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tyk.bookstore.back.order.model.enume.OrderState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @author tyk
 * @description 订单核心信息
 */

@Schema(name = "Order", description = "订单")
@TableName("`order`")
@Data
public class OrderDo implements Serializable {
    @Serial
    private static final long serialVersionUID = 1;

    @Schema(description = "ID")
    @TableId("id")
    private Long id;

    @Schema(description = "父订单ID")
    @TableField("parent_id")
    private Long parentId;

    @Schema(description = "订单号")
    @TableField("order_no")
    private String orderNo;

    @Schema(description = "会员ID")
    @TableField("member_id")
    private Long memberId;

    @Schema(description = "订单金额")
    @TableField("amount")
    private BigDecimal amount;

    @Schema(description = "运费金额")
    @TableField("freight")
    private BigDecimal freight;

    @Schema(description = "商品总重量")
    @TableField("weight")
    private Long weight;

    @Schema(description = "备注")
    @TableField("note")
    private String note;

    @Schema(description = "订单状态")
    @TableField("state")
    private OrderState state;

    @Schema(description = "仓库ID")
    @TableField("warehouse_id")
    private Long warehouseId;

    @Schema(description = "运单ID")
    @TableField("waybill_id")
    private Long waybillId;

    @Schema(description = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;
}
